#include<stdio.h>
#include "SDL_comm.h"
#include "SDL.h"

void SDL_tt(){
	char video_driver_name[255] = {0};
	SDL_VideoDriverName(video_driver_name,254);
	printf("video_driver_name:%s\n",video_driver_name);

	SDL_Rect **modes;
	modes = SDL_ListModes(NULL,SDL_FULLSCREEN|SDL_HWSURFACE);
	if(modes == (SDL_Rect **)0){
		printf("no modes available!\n");
		return;
	}
	if(modes == (SDL_Rect **)-1){
		printf("All resolutions availables.\n");
		return;
	}
	int i = 0;
	for(i=0;modes[i];++i){
		printf("w: %d x y:%d\n",modes[i]->w,modes[i]->h);
	}
	uint32_t rgb = SDL_MapRGB(videoinfo->vfmt,7,38,103);
	SDL_SetColorKey(screen,1,rgb);

	display_bmp("/mnt/other_c/xinye.bmp");
	SDL_SetColorKey(screen,1,rgb);

	if(SDL_Flip(screen) == -1){
		printf("SDL_Flip error.\n");
		return;
	}
}

int main(){
	printf("fun N:%d",fun(10));
	 return 0;
	 if(cum_SDL_init() == -1){
		 return -1;
	 }
	 SDL_WM_SetCaption("SDL test",NULL);
	 SDL_tt();
	 while(1){
		  process_events();
		  sleep(1);
	  }
	cum_SDL_Quit();
	return 0;
}
